package com.company.设计模式.工厂模式;

import com.company.设计模式.工厂模式.工厂方法模式.抽象类实现.ConcreteFactory1;
import com.company.设计模式.工厂模式.工厂方法模式.接口实现.iConcreteFactory1;
import com.company.设计模式.工厂模式.抽象工厂.AbstractFactory;
import com.company.设计模式.工厂模式.抽象工厂.ConcreteAbstractFactory2;
import com.company.设计模式.工厂模式.简单工厂模式.SimpleFactory;

/**
 * @Classname Client
 * @Description TODO
 * @Date 2021/9/10 13:48
 * @Created by ylr
 */
public class Client {
    public static void main(String[] args) {
        //简单工厂  封装实例创建的细节
        SimpleFactory simpleFactory = new SimpleFactory();
        Product product = simpleFactory.createProduct(1);

        String a = "a1";
        String b = "a"+1;
        assert a!=b;

        //工厂方法  将实例交给子类或者实现类
        //实现类
        iConcreteFactory1 concreteFactory1 = new iConcreteFactory1();
        Product product1 = concreteFactory1.factoryMethod();
        // 继承
        ConcreteFactory1 concreteFactory11 = new ConcreteFactory1();
        Product product2 = concreteFactory11.factoryMethod();

        //抽象工厂
        AbstractFactory concreteAbstractFactory2 = new ConcreteAbstractFactory2();
        Product newProduct = concreteAbstractFactory2.newProduct();
        AbstractProductA newAbstractProductA = concreteAbstractFactory2.newAbstractProductA();


    }//mq  某个通道并发高点
}
